//
//  KYLeftViewCell.m
//  kuaiyi
//
//  Created by 杨亮 on 16/3/14.
//  Copyright © 2016年 kuaiyi. All rights reserved.
//

#import "KYLeftViewCell.h"
#import "Header.h"
#import <Masonry.h>
#import "Header.h"

@interface KYLeftViewCell ()
@property (nonatomic, weak)UILabel *nameLabel;
@property (nonatomic, weak)UIImageView *iconImage;
@end

@implementation KYLeftViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setUpUI];
           }
    return self;
}
-(void)setUpUI{
    UILabel *nameLabel = [[UILabel alloc]init];
    [self.contentView addSubview:nameLabel];
    self.nameLabel = nameLabel;
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];
    UIImageView *iconImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"jt"]];
    [self.contentView addSubview:iconImage];
    self.iconImage = iconImage;
    [iconImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(-(ScreenWith-drawerWidth-20));
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.width.equalTo(@10);
        make.height.equalTo(@10);
    }];

}
- (void)awakeFromNib {
    // Initialization code
}
-(void)setName:(NSString *)name{
    _name = name;
    self.nameLabel.text = name;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    
}

@end
